﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.IO;

namespace yq.IService
{
    [ServiceContract]
    public interface IUpload
    {
        /// <summary>
        /// 上传文件
        /// </summary>
        /// <param name="fliebyte"></param>
        /// <param name="file"></param>
        /// <returns></returns>
        [OperationContract]
        yq.Dictionary.ReturnValue<string> UpFile(byte[] fliebyte, yq.Model.Logic.SysFile file);

        /// <summary>
        /// 上传文件
        /// </summary>
        /// <param name="txt"></param>
        /// <param name="modelId"></param>
        /// <returns></returns>
        [OperationContract]
        yq.Dictionary.ReturnValue<string> UpTxt(string txt, string modelId);

        /// <summary>
        /// 编辑文本
        /// </summary>
        /// <param name="id"></param>
        /// <param name="txt"></param>
        /// <returns></returns>
        [OperationContract]
        yq.Dictionary.ReturnValue<string> EditTxt(string id, string txt);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [OperationContract]
        bool DeleteFile(string id);


        /// <summary>
        /// 获取文本
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [OperationContract]
        string DownFileTxt(string id);

        /// <summary>
        /// 下载文件
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [OperationContract]
        byte[] DownFile(string id);

        /// <summary>
        /// 剪切图片
        /// </summary>
        /// <param name="id"></param>
        /// <param name="maxWidth"></param>
        /// <param name="maxHeight"></param>
        /// <param name="quality"></param>
        /// <returns></returns>
        byte[] DownFileImg(string id, int maxWidth, int maxHeight, int quality);
    }
}
